package model;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;

public class Result {

	private String _title;
	private String _abstract;
	private String _url;

	private Keyterms keyterms;

    public void setKeyterms(Keyterms keyterms) {
        this.keyterms = keyterms;
    }
    public String getTitle() {
		return _title;
	}
	public void setTitle(String _title) {
	    this._title = _title.replaceAll("\\<[^\\>]*\\>", "");
	}
	public String getAbstract() {
		return _abstract;
	}
	public void setAbstract(String _abstract) {
	    this._abstract = _abstract.replaceAll("\\<[^\\>]*\\>", "");
	}
	public String getUrl() {
		return _url;
	}
	public void setUrl(String _url) {
	    this._url = _url;
	}
	
	public String getKeyterms() {
	  return keyterms.toString();
	}
	
	@Override
	public String toString() {
		return "Titulo: " + _title + "\n" + 
		       "Abstract: " + _abstract + "\n" + 
		       "URL: " + _url + "\n" + 
		       "Termos-chave: " + (keyterms!=null ? keyterms.toString() : "N/A") + "\n";
	}
	
}
